package com.xin.uploadanddownload.test;

import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageTree;
import org.apache.pdfbox.pdmodel.interactive.action.PDActionJavaScript;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args){
        String path = "D:\\xss23.pdf";
        File file = new File(path);
        System.out.println(file.exists());
//        try {
//            PDDocument pdDocument = PDDocument.load(file);
//            PDPageTree pages = pdDocument.getPages();
//            boolean b = IntStream.range(0, 1).anyMatch(i -> {
//                PDPage page = pages.get(i);
////                System.out.println(page.getCOSObject().toString());
//                return page.getCOSObject().toString().contains("COSName{JS}");
//            });
//            IntStream range = IntStream.range(0, 1);
//            System.out.println(b);
//            pdDocument.save(path);
//            pdDocument.close();
//        } catch (IOException e) {
//            throw new RuntimeException(e);
//        }finally {
//
//        }
    }
}